home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16383 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  45 lines

  1. Path: news.urz.uni-heidelberg.de!usenet
  2. From: pstarzet@ix.urz.uni-heidelberg.de (Paul Starzetz)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: easy c++ question
  5. Date: 10 Apr 1996 16:25:12 GMT
  6. Organization: University of Heidelberg, Germany
  7. Distribution: world
  8. Message-ID: <4kgnd8$5hp@sun0.urz.uni-heidelberg.de>
  9. References: <316901DA.3138C677@ablecom.net>
  10. Reply-To: pstarzet@ix.urz.uni-heidelberg.de
  11. NNTP-Posting-Host: aixterm7.urz.uni-heidelberg.de
  12.  
  13. In article 3138C677@ablecom.net,  The Letter O <jczech@ablecom.net> writes:
  14.  
  15. class stack {
  16. >    private:
  17. >        int count;       // number of items in the stack
  18. >        int data[100];   // the items themselves
  19. >    public:
  20. >    .
  21. >inline stack::stack(void)
  22. >{
  23. >        count = 0;      // zero the stack
  24. >        cout << "constructor has been called\n";
  25. >}
  26. >//==============================================
  27. >
  28. try to flush the output stream, otherwise you will not see anything!
  29. I have some Unix experience and have already encoutered this problem.
  30. Try:
  31.  
  32. #include <iomanip.h>
  33.  
  34. inline stack::stack(void)
  35. {
  36.         count = 0;      // zero the stack
  37.         cout << "constructor has been called\n";
  38.         cout << flush;     
  39. }
  40.  
  41. ...otherwise use another compiler !!!
  42.  
  43.  
  44.  
  45.